<?php
/**
 * Created by PhpStorm.
 * User: yf
 * Date: 2018/8/15
 * Time: 上午10:39
 */

namespace App\HttpController;

use EasySwoole\Http\AbstractInterface\AbstractRouter;
use FastRoute\RouteCollector;
use EasySwoole\Http\Request;
use EasySwoole\Http\Response;

class Router extends AbstractRouter
{
    function initialize(RouteCollector $r)
    {
        // $this->setGlobalMode(true);
        $r->addGroup('/api', function (RouteCollector $r) {
            $r->addRoute('GET', '/user', '/Api/Admin/User/getAll');
            $r->addRoute('POST', '/login', '/Api/Admin/Auth/login');
        });
    }
}